#pragma once
#include "common.h"

namespace algorithms
{
  template <typename ITERATORA, typename ITERATORB>
  inline void copy(ITERATORA sourceBegin, ITERATORA sourceEnd, ITERATORB destination)
  {
    while (sourceBegin != sourceEnd)
      *destination++ = *sourceBegin++;
  }

  template <typename ITERATORA, typename ITERATORB>
  inline void copy(ITERATORA sourceBegin, ITERATORA sourceEnd, ITERATORB destinationStart, ITERATORB destinationEnd)
  {
    while (sourceBegin != sourceEnd && destinationStart != destinationEnd)
      *destinationStart++ = *sourceBegin++;
  }

  template <typename ITERATORA, typename ITERATORB>
  inline void reverse_copy(ITERATORA sourceBegin, ITERATORA sourceEnd, ITERATORB destination)
  {
    while (sourceEnd != sourceBegin)
      *destination++ = *sourceEnd--;
  }
}

